Class definition for objects that help resetting boolean variables. More...
#include <fcleanup.h>
Public Member Functions | |
FBoolSetter (bool &_toSet) | |
Constructor. _toSet is a reference to the boolean that is set to TRUE immediately in this constructor call and gets reset to FALSE when this FBoolSetter object's destructor is executed. | |
~FBoolSetter () | |
Destructor. Resets the at construction time passed boolean to FALSE. | |
Data Fields | |
bool & | toSet |
Remembers the boolean that is to be reset during destruction. |
Class definition for objects that help resetting boolean variables.
A stack allocated object of this type autonomically sets an at construction time passed boolean variable immediately to TRUE and resets the same variable to FALSE when it reaches the end of its own scope.
Intended usage:
bool theBoolean = false; { Steinberg::FBoolSetter theBoolSetter (theBoolean); // Here the constructor of theBoolSetter sets theBoolean to TRUE. // Do something. } // Here the destructor of theBoolSetter resets theBoolean to FALSE.
FBoolSetter | ( | bool & | _toSet | ) | [inline] |
Constructor. _toSet is a reference to the boolean that is set to TRUE immediately in this constructor call and gets reset to FALSE when this FBoolSetter object's destructor is executed.
~FBoolSetter | ( | ) | [inline] |
Destructor. Resets the at construction time passed boolean to FALSE.
bool& toSet |
Remembers the boolean that is to be reset during destruction.